import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;

public class Test04 {
    public static void main(String[] args) {
        ArrayList<String> list=new ArrayList<>();
        Collections.addAll(list,"张三","李四","王五","赵六","钱七");
        /*Random r=new Random();
        int index=r.nextInt(list.size());*/
        /*String name=list.remove(index);*/

        for (int i = 0; i < 10; i++) {
            System.out.println("============");
            int len=list.size();
            Random r=new Random();
            ArrayList<String> list1=new ArrayList<>();
            for (int j = 0; j < len; j++) {

                int index=r.nextInt(list.size());
                String name=list.remove(index);
                System.out.println(name);
                list1.add(name);
            }
            list.addAll(list1);
            list1.clear();
            }


        }
    }

